package dr.request.user.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dr.controller.*;
import dr.request.dao.*;
import dr.request.domain.*;

public class RequestUpdateProAction extends ActionSupportLogin{
	
	public String execute(HttpServletRequest request, 
			HttpServletResponse response)throws Throwable{
		
		request.setCharacterEncoding("euc-kr");
		String pageNum = request.getParameter("pageNum");
		
		Request req = new Request();
		req.setNum(Integer.parseInt(request.getParameter("num")));
		req.setSubject(request.getParameter("subject"));
		req.setContent(request.getParameter("content"));
		
		RequestDAO reqDAO = RequestDAO.getInstance();
		int check = reqDAO.updateArticle(req);
		
		request.setAttribute("pageNum", pageNum);
		request.setAttribute("check", new Integer(check));
		
		return "/request/updatePro.jsp";
	}

}
